package com.company.finance.ddd.common;

/**
 * @author wanglei
 */
public enum FlagEnum {

    /**
     *
     */
    YES('y'), NO('n');

    private final char flag;

    FlagEnum(char flag) {
        this.flag = flag;
    }

    public static FlagEnum getFlag(char flag) {
        if (YES.flag == flag) {
            return YES;
        } else if (NO.flag == flag) {
            return NO;
        } else {
            throw new RuntimeException("");
        }
    }
}
